# Makefile generated by VCS to build your model
# This file may be modified; VCS will not overwrite it unless -Mupdate is used

# define default verilog source directory 
VSRC=..

# Override TARGET_ARCH
TARGET_ARCH=

# Note: if make gives you errors about include, either get gmake, or
# replace the following line with the contents of the file filelist,
# EACH TIME IT CHANGES
# included file defines OBJS, and is automatically generated by vcs
include filelist

# Choose name of executable 
PRODUCTBASE=$(VSRC)/simv

PRODUCT=$(PRODUCTBASE)

# Product timestamp file. If product is newer than this one,
# we will also re-link the product.
PRODUCT_TIMESTAMP=product_timestamp

# Path to runtime library
CMODLIB=
RUNTIME=/remote/apps/synopsys/vcs/current/linux/lib/libvcsnew$(VCS_LIBEXT).so

# Select your favorite compiler

# Linux:
VCS_CC=gcc

# Loader
LD=g++
# Loader Flags
LDFLAGS= 

# C run time startup
CRT0=
# C run time startup
CRTN=
# Machine specific libraries
SYSLIBS=/remote/apps/synopsys/vcs/current/linux/lib/ctype-stubs_32.a -ldl -lz -lm  -lc -ldl

# Default defines
SHELL=/bin/sh

VCSTMPSPECARG=
VCSTMPSPECENV=
# NOTE: if you have little space in /tmp, but plenty in /foo,
#and you are using gcc, uncomment the next line
#VCSTMPSPECENV=TMPDIR=/foo

TMPSPECARG=$(VCSTMPSPECARG)
TMPSPECENV=$(VCSTMPSPECENV)
CC=$(TMPSPECENV) $(VCS_CC) $(TMPSPECARG)

# C flags for compilation
CFLAGS= -pipe -O -I/remote/apps/synopsys/vcs/current/include   

# Partial linking
LD_PARTIAL=ld -r -o
LIBS=/remote/apps/synopsys/vcs/current/linux/lib/libvirsim.a 
DOTLIBS=/remote/apps/synopsys/vcs/current/linux/lib/libvirsim.a 

product : $(PRODUCT_TIMESTAMP)
	@echo $(PRODUCT) up to date

objects : $(OBJS)

clean   :
	rm -f $(VCS_OBJS)

clobber : clean
	rm -f $(PRODUCT) $(PRODUCT_TIMESTAMP) 

$(PRODUCT_TIMESTAMP) : $(PRODUCT)
	-if [ -x $(PRODUCT) ]; then chmod -x $(PRODUCT); fi
	$(LD) $(CRT0) -o $(PRODUCT) $(LDFLAGS) $(OBJS) $(LIBS)   $(CMODLIB) $(RUNTIME)     $(SYSLIBS) $(LINK_TB) $(CRTN)  
	@touch $(PRODUCT_TIMESTAMP)

$(PRODUCT) : $(OBJS) $(DOTLIBS) $(CMODLIB)  $(RUNTIME) 
	@touch $(PRODUCT)

